/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1637288915587_7121';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  /**start 配置art */
  config.view = {
    defaultViewEngine: 'nunjucks',
    mapping: {
      '.html': 'nunjucks',
    },
  };

  /**end art */
  // config.arttemplate = {
  //   escape: true,
  //   debug: false,
  //   bail: true,
  //   cache: true
  // };

  /**配置中间件 */
  config.middleware = ['cors'];
  // config.test = {
  //   match: "/music",
  //   title: "中间件"
  // }

  /**配置安全地址 */
  config.security = {
    csrf: {
      enable: false
    }
  }

  /**配置数据库 */
  config.mongodb = {
    app: true,
    agent: false,
    client: {
      hosts: '124.70.181.91:12021',
      db: 'Student',
    }
  }

  return {
    ...config,
    ...userConfig,
  };
};
